import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '器具名称',
    align: "center",
    dataIndex: 'uteName'
  },
  {
    title: '型号规格',
    align: "center",
    dataIndex: 'specification'
  },
  {
    title: '出厂编号',
    align: "center",
    dataIndex: 'manuNumber'
  },
  {
    title: '溯源方式',
    align: "center",
    dataIndex: 'traceabilityMethod'
  },
  {
    title: '溯源单位',
    align: "center",
    dataIndex: 'lastfirm'
  },
  {
    title: '溯源日期',
    align: "center",
    dataIndex: 'lastinspectDate'
  },
  {
    title: '有效日期',
    align: "center",
    dataIndex: 'expirationDate'
  },
  {
    title: '证书报告',
    align: "center",
    dataIndex: 'certificate'
  },
  {
    title: '确认时间',
    align: "center",
    dataIndex: 'confirmDate'
  },
  {
    title: '确认结果',
    align: "center",
    dataIndex: 'confirmResult'
  },
  {
    title: '确认人',
    align: "center",
    dataIndex: 'confirmPerson'
  },
  {
    title: '器具id',
    align: "center",
    dataIndex: 'uteId'
  },
];
//确认记录
export const columnsNote: BasicColumn[] = [
 
  {
    title: '确认时间',
    align: "center",
    dataIndex: 'confirmDate',
    sorter: (a, b) => {
      return new Date(b.confirmDate).getTime() - new Date(a.confirmDate).getTime();
    }
  },
  {
    title: '确认结果',
    align: "center",
    dataIndex: 'confirmResult'
  },
  {
    title: '确认人',
    align: "center",
    dataIndex: 'confirmPerson'
  },
  // {
  //   title: '器具id',
  //   align: "center",
  //   dataIndex: 'uteId'
  // },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '器具名称',
    field: 'uteName',
    component: 'Input',
  },
  {
    label: '型号规格',
    field: 'specification',
    component: 'Input',
  },
  {
    label: '出厂编号',
    field: 'manuNumber',
    component: 'Input',
  },
  {
    label: '溯源方式',
    field: 'traceabilityMethod',
    component: 'Input',
  },
  {
    label: '溯源单位',
    field: 'lastfirm',
    component: 'Input',
  },
  {
    label: '溯源日期',
    field: 'lastinspectDate',
    component: 'Input',
  },
  {
    label: '有效日期',
    field: 'expirationDate',
    component: 'Input',
  },
  {
    label: '证书报告',
    field: 'certificate',
    component: 'Input',
  },
  {
    label: '确认时间',
    field: 'confirmDate',
    component: 'Input',
  },
  {
    label: '确认结果',
    field: 'confirmResult',
    component: 'Input',
  },
  {
    label: '确认人',
    field: 'confirmPerson',
    component: 'Input',
  },
  {
    label: '器具id',
    field: 'uteId',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
